package com.yuantu.judiciary.exception;

import com.yuantu.judiciary.common.CodeEnum;

/**
 * 服务异常
 *
 * @author syw
 * @since 2023-06-07
 **/
public class ServiceException extends RuntimeException {

    /**
     * 错误码
     */
    private final int errCode;

    public ServiceException(CodeEnum codeEnum) {
        super(codeEnum.getMessage());
        this.errCode = codeEnum.getCode();
    }

    public ServiceException(int errCode, String errMessage) {
        super(errMessage);
        this.errCode = errCode;
    }

    public int getCode() {
        return this.errCode;
    }

}
